package offer.algorithm;

import java.util.Arrays;

/**
 * Description：
 * Author: zhangc
 * Date：2017/7/27 23:21
 */
public class PokerContinuous44 {

    public static boolean isContinuous(int[] array, int k) {
        Arrays.sort(array);
        int zeroNum = 0;
        int miss = 0;
        for (int i = 0; i <array.length; i++) {
            if (array[ i ] == 0)
                zeroNum++;
            else {
                if (i + 1 < array.length) {
                    if (array[ i ] == array[ i + 1 ])
                        return false;
                    else miss += (array[ i + 1 ] - array[ i ] - 1);
                }

            }
        }
        return zeroNum >= miss;
    }

}
